package org.example.springbook.enums;

public enum BookStatusEnums {
    DELETE(0,"无效"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅"),
    ;
    private Integer code;
    private String desc;
    public static BookStatusEnums getEnumsByCode(Integer code) {
        switch (code) {
            case 0:return BookStatusEnums.DELETE;
            case 1:return BookStatusEnums.NORMAL;
            case 2:return BookStatusEnums.FORBIDDEN;
        }
        return BookStatusEnums.DELETE;
    }

    BookStatusEnums(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
